package homework;

public class Test8 {
    public static void main(String[] args) {
        String a="abcba";
        String b="上海自来水来自海上";
        reverseString(a);
        reverseString(b);
        reverseString("");

    }
    public static void reverseString(String s){
        if (s.equals("")){
            System.out.println("不能为空");
        }
        else if (s.equals(new StringBuilder(s).reverse().toString())){
            System.out.println(s+"是对称的");
        }
    }
}
